package org.railage.common.protocol;

import java.io.Serializable;

/**
 * Message class. Client communicates with server by serializing its objects
 * through socket.
 * 
 * @author Cyril Fertikov
 * 
 */
public class Message implements Serializable {
	private static final long serialVersionUID = -4686362103114610272L;
	private String method = null;
	private Object obj = null;
	private int code = 0;

	public Message(String method, Object obj) {
		this.method = method;
		this.obj = obj;
	}

	public Message(Object obj, int code) {
		this.obj = obj;
		this.code = code;
	}

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

	public Object getObj() {
		return obj;
	}

	public void setObj(Object obj) {
		this.obj = obj;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

}
